Xbasic

NodeServices::TimeBasedTokenToken Method

Syntax

C Token(C key)

Arguments

keyCharacter

A secret "key" used to generate the token. The secret passed to the function should be 16 characters in length if you plan to use the Google Authenticator.

Returns

resultCharacter

Returns a token.

Description

Generate a time based token given a provided secret.

Discussion

The NodeServices::TimeBasedToken Token() method generates a time based token for a provided secret. Time based tokens are often used with an application such as Google Authenticator for two-factor authentication.

'generate a time based token
'NOTE: in many cases the user will use an App like Google Authenticator
'to generate the token
dim tbt as nodeservices::timebasedtoken

dim secret as c = "abcdefghijklmnop" 'secret should be 16 characters if you plan to use Google Authenticator

dim token as c
token = tbt.Token(secret)